{{- $enable := and (default true .Params.toc) (default true .Site.Params.toc) -}}
{{- $toc := .TableOfContents -}}
{{- $valid := and $toc (and (ne $toc "<nav id=\"TableOfContents\"></nav>") (gt .WordCount .Site.Params.tocWordCount)) -}}
{{- return and $enable $valid -}}
